<?php

namespace myshop\paycenter\controller;

class PayCenter
{
    /**
     * @return Response
     * @author xaboy
     * @day 2020/6/3
     */
    public function wechatNotify()
    {
        try {
            if($this->request->header('content-type') === 'application/json'){
                return response(WechatService::create()->handleNotifyV3()->getContent());
            }
            return response(WechatService::create()->handleNotify()->getContent());
        } catch (Exception $e) {
            Log::info('支付回调失败:' . var_export([$e->getMessage(), $e->getFile() . ':' . $e->getLine()], true));
        }
    }
}